<template>
  <div id="regularstoplist" > 


          <el-table :data="list" style="width: 100%" :row-class-name="tableRowClassName" 
           :border="true" :height="dtheight" :header-cell-style="{background:'#4F81BC',color:'white'}"
          >

               
                <el-table-column label="时间"  align='center' >                   
                    <template slot-scope="scope">                   
                        <span >{{ scope.row.daytime_str }}</span>
                    </template>
                </el-table-column>
                 <el-table-column label="操作" align='center' >
                    <template slot-scope="scope">
                        <el-button size="mini"  type="primary"  plain @click="delect_but(scope.row)">删除</el-button> 
                    </template>
                </el-table-column>
                

            </el-table>  




   </div>
</template>

<script>

export default {
   name: 'regularstoplist',
   props:{
      list:{  
        //type:Array,
       default:()=>[]
     },
  },
  data () {
    return {
       my_id:'',
    }
  },
   components:{

  },
  created(){
     this.dtheight = window.innerHeight - 293
      
  },
  mounted (){
 
  },
  methods: {
  
      delect_but(row){
          var date = new Date();
          var time = date.getTime(); //明天时间戳         
          //console.log(time)
          var rowdate = new Date(row.daytime_str);
          var rowtime = rowdate.getTime();   //列表时间戳
          //console.log(rowtime)
          if(time >= rowtime){
               this.open1("今天之前的不可删除(包括今天)",'warning')   
          }else{

              this.$confirm('是否删除, 是否继续?', '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning'
                  }).then(() => {    
                          this.post("/market_close/delete", {
                             id:row.id
                          }).then(res => {

                              if(res.error_code == 0){
                              this.open1(res.result,'success')  //提示框
                              this.$emit('up_list_fun')
                              }else {
                              this.open1(res.message,'warning')
                          }

                      })
                  }).catch(() => {
                        this.$emit('up_list_fun')
                  });

          }
      }

  }
}
</script>


<style scoped>

</style>